<html>
<head><meta charset="utf-8"><title>Issue #70651 : A Rust crate wrapping the git-subtree script · clippy · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/index.html">clippy</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Issue.20.2370651.20.3A.20A.20Rust.20crate.20wrapping.20the.20git-subtree.20script.html">Issue #70651 : A Rust crate wrapping the git-subtree script</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="214999058"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Issue%20%2370651%20%3A%20A%20Rust%20crate%20wrapping%20the%20git-subtree%20script/near/214999058" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Muhammad Mominul Huque <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Issue.20.2370651.20.3A.20A.20Rust.20crate.20wrapping.20the.20git-subtree.20script.html#214999058">(Oct 29 2020 at 17:16)</a>:</h4>
<p>Hi!<br>
Here's the initial code of wrapping the <code>git-subtree</code>script. I named it as <code>gitree</code> <span aria-label="wink" class="emoji emoji-1f609" role="img" title="wink">:wink:</span> <br>
Most of the heavy lifting has been done by the <a href="https://crates.io/crates/run_script"><code>run_script</code></a> crate, so my initial mostly working (though I not tested it thoroughly) code is just a few lines: <a href="https://github.com/mominul/gitree/blob/main/src/main.rs">https://github.com/mominul/gitree/blob/main/src/main.rs</a> <span aria-label="grinning face with smiling eyes" class="emoji emoji-1f601" role="img" title="grinning face with smiling eyes">:grinning_face_with_smiling_eyes:</span> <br>
I just wanted to chime in here with my initial code, so please add your comments about it!</p>



<a name="215063871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Issue%20%2370651%20%3A%20A%20Rust%20crate%20wrapping%20the%20git-subtree%20script/near/215063871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Issue.20.2370651.20.3A.20A.20Rust.20crate.20wrapping.20the.20git-subtree.20script.html#215063871">(Oct 30 2020 at 07:48)</a>:</h4>
<p>heh, that looks about right. Good idea wrt the <code>run_script</code> crate. The only thing I see that could be changed would be that <code>println!("{}", error);</code> could use <code>eprintln</code> instead</p>



<a name="215064364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Issue%20%2370651%20%3A%20A%20Rust%20crate%20wrapping%20the%20git-subtree%20script/near/215064364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Muhammad Mominul Huque <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Issue.20.2370651.20.3A.20A.20Rust.20crate.20wrapping.20the.20git-subtree.20script.html#215064364">(Oct 30 2020 at 07:58)</a>:</h4>
<p>Thanks! <span aria-label="blush" class="emoji emoji-1f60a" role="img" title="blush">:blush:</span> <br>
Good catch! I'll apply your review.</p>



<a name="215066366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Issue%20%2370651%20%3A%20A%20Rust%20crate%20wrapping%20the%20git-subtree%20script/near/215066366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Muhammad Mominul Huque <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Issue.20.2370651.20.3A.20A.20Rust.20crate.20wrapping.20the.20git-subtree.20script.html#215066366">(Oct 30 2020 at 08:30)</a>:</h4>
<p>I have sent a invitation to <code>rust-lang-owner</code> for this repo <a href="https://github.com/mominul/gitree">https://github.com/mominul/gitree</a></p>



<a name="215201315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Issue%20%2370651%20%3A%20A%20Rust%20crate%20wrapping%20the%20git-subtree%20script/near/215201315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Issue.20.2370651.20.3A.20A.20Rust.20crate.20wrapping.20the.20git-subtree.20script.html#215201315">(Oct 31 2020 at 17:15)</a>:</h4>
<p><span class="user-mention" data-user-id="200694">@Muhammad Mominul Huque</span> Thanks for looking into this! Sadly, this doesn't work yet, since the <code>git-subtree.sh</code> script calls itself recursively: <a href="https://github.com/gitgitgadget/git/blob/fe2e4819b869725f870cd3ce99f1f8150fe17dc1/contrib/subtree/git-subtree.sh#L1013">https://github.com/gitgitgadget/git/blob/fe2e4819b869725f870cd3ce99f1f8150fe17dc1/contrib/subtree/git-subtree.sh#L1013</a></p>
<p>Maybe this can be fixed, by replacing this string with the <code>gitree</code> equivalent before running the script.</p>



<a name="215204362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Issue%20%2370651%20%3A%20A%20Rust%20crate%20wrapping%20the%20git-subtree%20script/near/215204362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Muhammad Mominul Huque <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Issue.20.2370651.20.3A.20A.20Rust.20crate.20wrapping.20the.20git-subtree.20script.html#215204362">(Oct 31 2020 at 18:16)</a>:</h4>
<p>Oops! Thanks for noticing that! I'll try to fix it <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="215249499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Issue%20%2370651%20%3A%20A%20Rust%20crate%20wrapping%20the%20git-subtree%20script/near/215249499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Muhammad Mominul Huque <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Issue.20.2370651.20.3A.20A.20Rust.20crate.20wrapping.20the.20git-subtree.20script.html#215249499">(Nov 01 2020 at 15:45)</a>:</h4>
<p>I think I have fixed that bug, I have also published a new version of that crate.<br>
Can you check it again please? <span class="user-mention" data-user-id="264664">@flip1995</span></p>



<a name="215251984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Issue%20%2370651%20%3A%20A%20Rust%20crate%20wrapping%20the%20git-subtree%20script/near/215251984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Muhammad Mominul Huque <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Issue.20.2370651.20.3A.20A.20Rust.20crate.20wrapping.20the.20git-subtree.20script.html#215251984">(Nov 01 2020 at 16:49)</a>:</h4>
<p>I have pushed an update, so please recheck it again if anyone of you has tested it in the meantime.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>